import 'package:development_assistant/ui/screen/widget/home_background.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:google_fonts/google_fonts.dart';

class GuidePage extends StatelessWidget {
  final controller=PageController(initialPage: 0);
  GuidePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: PageView(
        controller: controller,
        children: _guidePageList(),
      ),
    );
  }

  _guidePageList(){
    return <Widget>[
      Container(
        decoration: const BoxDecoration(
          gradient: LinearGradient(
            colors: [
              Color(0xfff0896a),
              Color(0xfff3a387),
              Color(0xfff7bfa9),
              Color(0xfffad6c6),
              Color(0xfffdeae0)
            ],
            begin: Alignment.topCenter,
            end: Alignment.bottomCenter
          )
        ),
        child: Column(
          children: [
            SizedBox(height: 100.h,),
            Image.asset("images/guide_one.png"),
            Text("记录你开发的配置信息",style: GoogleFonts.lato(
              textStyle: TextStyle(
                color: Color(0xffC77D7e),
                fontSize: 30.sp
              ),
              fontWeight: FontWeight.bold
            ),),
            Text("记录服务器与容器配置信息",style: GoogleFonts.lato(
                textStyle: TextStyle(
                    color: Colors.white,
                    fontSize: 15.sp
                ),
                fontWeight: FontWeight.bold
            )),
            Text("快速并管理创建数据库",style: GoogleFonts.lato(
                textStyle: TextStyle(
                    color: Colors.white,
                    fontSize: 15.sp
                ),
                fontWeight: FontWeight.bold
            )),
          ],
        )
      ),
      Container(
          decoration: const BoxDecoration(
              gradient: LinearGradient(
                  colors: [
                    Color(0xfff0896a),
                    Color(0xfff3a387),
                    Color(0xfff7bfa9),
                    Color(0xfffad6c6),
                    Color(0xfffdeae0)
                  ],
                  begin: Alignment.topCenter,
                  end: Alignment.bottomCenter
              )
          ),
          child: Column(
            children: [
              SizedBox(height: 100.h,),
              Image.asset("images/guide_two.png"),
              Text("接口管理与自动化测试",style: GoogleFonts.lato(
                  textStyle: TextStyle(
                      color: Color(0xffC77D7e),
                      fontSize: 30.sp
                  ),
                  fontWeight: FontWeight.bold
              ),),
              Text("高效管理你的接口",style: GoogleFonts.lato(
                  textStyle: TextStyle(
                      color: Colors.white,
                      fontSize: 15.sp
                  ),
                  fontWeight: FontWeight.bold
              )),
              Text("模拟用户情况进行自动化接口测试",style: GoogleFonts.lato(
                  textStyle: TextStyle(
                      color: Colors.white,
                      fontSize: 15.sp
                  ),
                  fontWeight: FontWeight.bold
              )),
            ],
          )
      ),
      Container(
          decoration: const BoxDecoration(
              gradient: LinearGradient(
                  colors: [
                    Color(0xfff0896a),
                    Color(0xfff3a387),
                    Color(0xfff7bfa9),
                    Color(0xfffad6c6),
                    Color(0xfffdeae0)
                  ],
                  begin: Alignment.topCenter,
                  end: Alignment.bottomCenter
              )
          ),
          child: Column(
            children: [
              SizedBox(height: 80.h,),
              Image.asset("images/guide_three.png"),
              Text("DevTools",style: GoogleFonts.lato(
                  textStyle: TextStyle(
                      color: Color(0xffC77D7e),
                      fontSize: 50.sp
                  ),
                  fontWeight: FontWeight.bold
              ),),
              Text("无时无刻能帮助你的开发助手",style: GoogleFonts.lato(
                  textStyle: TextStyle(
                      color: Colors.white,
                      fontSize: 15.sp
                  ),
                  fontWeight: FontWeight.bold
              )),
              Text("提高你的开发效率",style: GoogleFonts.lato(
                  textStyle: TextStyle(
                      color: Colors.white,
                      fontSize: 15.sp
                  ),
                  fontWeight: FontWeight.bold
              )),
              SizedBox(height: 10.h,),
              ElevatedButton(
                  style: ElevatedButton.styleFrom(
                      backgroundColor: const Color(0xffC77D7D),
                      foregroundColor: Colors.white,
                      shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(10)
                      )
                  ),
                  onPressed: (){
                    Get.toNamed("/Home",arguments: {"selectIndex":0});
                  },
                  child: Text("开始使用",style: TextStyle(fontWeight: FontWeight.bold),)
              )
            ],
          )
      ),
    ];
  }


}
